package com.example.gorannet;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RatingBar;
import android.widget.RatingBar.OnRatingBarChangeListener;

public class evaluation extends Activity
{
    private BootstrapButton btnEvaluateFinal;
    private RatingBar communicationRating, understandingRating, professionalismRating, timeRating;
    private String btnText = "Evaluate";
    private String commVal,unVal, proVal, timeVal;
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.evaluation_layout);
       
        btnEvaluateFinal = (BootstrapButton) findViewById(R.id.evaluateFinal);
        communicationRating = (RatingBar) findViewById(R.id.communicationRating);
        communicationRating.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
            @Override
            public void onRatingChanged(RatingBar ratingBar, float rating,
                    boolean fromUser) {

                commVal = String.valueOf(rating);

            }
        });
        understandingRating = (RatingBar) findViewById(R.id.understandRating);
        understandingRating.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
            @Override
            public void onRatingChanged(RatingBar ratingBar, float rating,
                    boolean fromUser) {

                unVal = String.valueOf(rating);

            }
        });
        timeRating = (RatingBar) findViewById(R.id.timeRating);
        timeRating.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
            @Override
            public void onRatingChanged(RatingBar ratingBar, float rating,
                    boolean fromUser) {

                timeVal = String.valueOf(rating);

            }
        });
        professionalismRating = (RatingBar) findViewById(R.id.professionalityRating);
        professionalismRating.setOnRatingBarChangeListener(new OnRatingBarChangeListener() {
            @Override
            public void onRatingChanged(RatingBar ratingBar, float rating,
                    boolean fromUser) {

                proVal = String.valueOf(rating);

            }
        });

        btnEvaluateFinal.setText(btnText);
        btnEvaluateFinal.setOnClickListener(new View.OnClickListener()
        {

            @Override
            public void onClick(View v)
            {
                // TODO Auto-generated method stub
                Intent in = new Intent(getApplicationContext(), CaptureSignature.class);
                in.putExtra("doeval", "yes");
                in.putExtra("comm", commVal);
                in.putExtra("understand", unVal);
                in.putExtra("prof", proVal);
                in.putExtra("timeV", timeVal);
                startActivity(in);
            }
        });
    }
}
